package test2;

import java.util.Random;

/**
 * Girlfriend
 *
 * @author 28189
 * @since 2024/11/30 19:35
 */
public class Girlfriend {
    private String name;
    private int age;
    private char sex;
    private String face;
    String[] faces = {"御姐","萝莉","清纯女高","副驾千金"};
    public Girlfriend() {
    }
    public char getSex() {
        return sex;
    }

    public Girlfriend(String name, int age, char sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        setFace(sex);
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getFace() {
        return face;
    }

    public void setFace(char sex) {
        Random r= new Random();
        if(sex=='女'){
            int index = r.nextInt(faces.length);
            this.face = faces[index];
        }
    }

    public void eat(){
        System.out.println("女朋友在吃饭");
    }
    public void sleep(){
        System.out.println("女朋友在睡觉");
    }
    public void play(){
        System.out.println("女朋友在玩耍");
    }
    public void showRoleinfo(){
        System.out.println("女朋友信息如下：");
        System.out.println("姓名："+ getName());
        System.out.println("年龄："+ getAge());
        System.out.println("身份："+ getFace());
    }
} 
